﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NHibernate.Tool.hbm2ddl;
using ThunderJob.Persistence;

namespace ThunderJob.IntegrationTest.TestBases
{
    public class PersistenceTestConfiguration
    {
        public static ISession Session { get; private set; }

        public static void Init()
        {
            NHibernateSession.Init("NHibernate.config",SessionContext.Simple);
            Session = NHibernateSession.CreateInStorage();
            new SchemaExport(NHibernateSession.Configuration).Execute(false, true, false, Session.Connection, null);
            Session.Clear();
        }

        public static void Reset()
        {
            NHibernateSession.Reset();
        }
    }
}
